% This m-file is to export the isotherms
close all
clear all
clc

FileName={
    'sph01.dat';  % KCl w/o Fe
    'sph01.dat';  % KCl/FeCl3 pH 3
    'sph01.dat';  % KCl/FeCl3 pH 7.1
    'sph01.dat';  % KCl/FeCl3 pH 4
    'sph02.dat';  % KCl/FeCl3 pH 2
    'sph02.dat';  % KCl/FeCl3 pH 5
    }
ScanNum={
    106;  % KCl w/o Fe
    171;  % KCl/FeCl3 pH 3
    245;  % KCl/FeCl3 pH 7.1
    315;  % KCl/FeCl3 pH 4
    21;   % KCl/FeCl3 pH 2
    86;   % KCl/FeCl3 pH 5
    }
IsothermsFile={
    'sph01_scan106_iso.txt';   % #1 KCl w/o Fe
    'sph01_scan171_iso.txt';   % #2 KCl/FeCl3 pH 3
    'sph01_scan245_iso.txt';  % #3  KCl/FeCl3 pH 7.1
    'sph01_scan315_iso.txt';  % #4  KCl/FeCl3 pH 4
    'sph02_scan21_iso.txt';  % #5   KCl/FeCl3 pH 2
    'sph02_scan86_iso.txt'  % #6    KCl/FeCl3 pH 5
    }
FileNum=6

Data=plcol(FileName{FileNum}, ScanNum{FileNum}, 'AREA', 'PRESSURE');
area=Data(:,1);
pressure=Data(:,2);
close all
figure
plot(area,pressure,'-','LineWidth',3);
Txt_Save(IsothermsFile{FileNum},area,pressure);
